home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / Servers.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  3KB  |  100 lines

  1. /*
  2.      File:        Servers.h
  3.  
  4.      Contains:    Server Interfaces.
  5.  
  6.      Version:    Technology:    System 8
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __SERVERS__
  19. #define __SERVERS__
  20.  
  21. #ifndef __CODEFRAGMENTS__
  22. #include <CodeFragments.h>
  23. #endif
  24. #ifndef __KERNEL__
  25. #include <Kernel.h>
  26. #endif
  27. #ifndef __FILEMANAGERTYPES__
  28. #include <FileManagerTypes.h>
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #if PRAGMA_IMPORT_SUPPORTED
  36. #pragma import on
  37. #endif
  38.  
  39. #if PRAGMA_ALIGN_SUPPORTED
  40. #pragma options align=power
  41. /* the following contents can only be used by compilers that support PowerPC struct alignment */
  42.  
  43. #if FOR_SYSTEM8_PREEMPTIVE
  44. typedef struct OpaqueServerID* ServerID;
  45.  
  46. enum {
  47.     kCreateServerResType        = 'srvr',
  48.     kCreateServerResID            = 0
  49. };
  50.  
  51. typedef OptionBits CreateServerOptions;
  52.  
  53. enum {
  54.     kServerReservesLowMem        = (1L << 0),                    /* Cannot be enabled with kServerIsPrivileged*/
  55.     kServerIsPrivileged            = (1L << 1),                    /* Cannot be enabled with kServerReservesLowMem*/
  56.     kCreateServerForLookup        = (1L << 2),
  57.     kCreateServerAtStartup        = (1L << 3)
  58. };
  59.  
  60. struct CreateServerDescriptor {
  61.     CreateServerOptions             createOptions;
  62.     TaskName                         name;
  63.     TaskOptions                     taskOptions;
  64.     ByteCount                         stackSize;
  65.     Str63                             serverName;
  66. };
  67. typedef struct CreateServerDescriptor CreateServerDescriptor;
  68.  
  69. typedef CreateServerDescriptor *CreateServerDescriptorPtr;
  70. typedef void (*ServerMainEntry)(ServerID server);
  71. extern OSStatus CreateServer(FSObjectRef fileRef_t, const KernelNotification *deathNotification_i, Duration timeout_i, Str63 serverName_o, ServerID *server_o, void **refcon_o);
  72.  
  73. extern OSStatus CreateServerAsync(FSObjectRef fileRef_t, const KernelNotification *deathNotification_i, const KernelNotification *asyncNotification_i, Str63 serverName_o, ServerID *server_o, void **refcon_o);
  74.  
  75. extern OSStatus RegisterServer(FSObjectRef fileRef_t, Str63 serverName_o);
  76.  
  77. extern OSStatus DeregisterServer(ConstStr63Param serverName_t);
  78.  
  79. extern OSStatus LookupServer(ConstStr63Param serverName_t, Duration timeout_i, ServerID *server_o, void **refcon_o);
  80.  
  81. extern OSStatus LookupServerAsync(ConstStr63Param serverName_t, const KernelNotification *asyncNotification_i, ServerID *server_o, void **refcon_o);
  82.  
  83. extern OSStatus ServerCreated(ServerID server_t, void *refcon_i);
  84.  
  85. #endif
  86.  
  87. #pragma options align=reset
  88. #endif /* PRAGMA_ALIGN_SUPPORTED */
  89.  
  90. #if PRAGMA_IMPORT_SUPPORTED
  91. #pragma import off
  92. #endif
  93.  
  94. #ifdef __cplusplus
  95. }
  96. #endif
  97.  
  98. #endif /* __SERVERS__ */
  99.  
  100.